using UnityEngine;
using UnityEngine.Advertisements;

namespace MinesweeperPlus.Scripts.Objects.Advertisements
{
    public class Ads : IUnityAdsInitializationListener
    {
        #region Constants
        private const string ANDROID_GAME_ID = "5189907";
        private const string IOS_GAME_ID = "5189906";
        #endregion

        #region Ads Methods
        public Ads()
        {  
            var gameId = 
                (Application.platform == RuntimePlatform.IPhonePlayer) ? IOS_GAME_ID : ANDROID_GAME_ID;
            Advertisement.Initialize(gameId, true, this);
        }

        public void OnInitializationComplete()
        {
            Debug.Log($"{nameof(OnInitializationComplete)}");
        }

        public void OnInitializationFailed(UnityAdsInitializationError error, string message)
        {
            Debug.Log($"{nameof(OnInitializationFailed)} : {error.ToString()} - {message}");
        }
        #endregion
    }
}
